<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="zh" >
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="keywords" content="">
	<meta name="description" content="">
	<title >任务列表</title>
	<link href="css/bootstrap.min.css" rel="stylesheet"/>
	<link href="css/font-awesome.min.css?v=4.7.0" rel="stylesheet"/>
	<link href="ajax/libs/bootstrap-table/bootstrap-table.min.css?v=1.18.3" rel="stylesheet"/>
	<link href="css/animate.min.css?v=20210831" rel="stylesheet"/>
	<link href="css/style.min.css?v=20210831" rel="stylesheet"/>
	<link href="ruoyi/css/ry-ui.css?v=4.7.8" rel="stylesheet"/>
	<link href="ajax/libs/jquery-layout/jquery.layout-latest.css?v=1.4.4" rel="stylesheet"/>
	<!-- bootstrap-table 表格插件样式 -->
</head>
<body class="gray-bg">
	<div class="ui-layout-center">
		<div class="container-div">
			<div class="row">
				<div class="btn-group-sm" id="toolbar" role="group">
					<a class="btn btn-success" onclick="$.operate.add()" >
						<i class="fa fa-plus"></i> 新增任务
					</a>
				</div>
		        <div class="col-sm-12 select-table table-striped">
					<table id="bootstrap-table"></table>
				</div>
			</div>
		</div>
	</div>

	<script src="js/jquery.min.js?v=3.6.3"></script>
	<script src="js/bootstrap.min.js?v=3.3.7"></script>
	<!-- bootstrap-table 表格插件 -->
	<script src="ajax/libs/bootstrap-table/bootstrap-table.min.js?v=1.18.3"></script>
	<script src="ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=1.18.3"></script>
	<script src="ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js?v=1.18.3"></script>
	<!-- jquery-validate 表单验证插件 -->
	<script src="ajax/libs/validate/jquery.validate.min.js?v=1.19.3"></script>
	<script src="ajax/libs/validate/jquery.validate.extend.js?v=1.19.3"></script>
	<script src="ajax/libs/validate/messages_zh.js?v=1.19.3"></script>
	<!-- bootstrap-table 表格树插件 -->
	<script src="ajax/libs/bootstrap-table/extensions/tree/bootstrap-table-tree.min.js?v=1.18.3"></script>
	<!-- 遮罩层 -->
	<script src="ajax/libs/blockUI/jquery.blockUI.js?v=2.70.0"></script>
	<script src="ajax/libs/iCheck/icheck.min.js?v=1.0.3"></script>
	<script src="ajax/libs/layer/layer.min.js?v=3.7.0"></script>
	<script src="ajax/libs/layui/layui.min.js?v=2.8.18"></script>
	<script src="ruoyi/js/common.js?v=4.7.8"></script>
	<script src="ruoyi/js/ry-ui.js?v=4.7.8"></script>
	<script src="ajax/libs/jquery-layout/jquery.layout-latest.js?v=1.4.4"></script>
	<script  inline="javascript">
		$(function() {
			var options = {
				url: "taskList",//查询列表数据要访问的路径
				viewUrl: "mx/{id}",//调用$.operate.view时，会访问该路径
				createUrl: "addY",//调用$.operate.add()时，会访问该路径
				updateUrl: "editY/{id}",//调用$.operate.edit()时，会访问该路径
				columns: [
					{
						field: 'id',
						title: '序号'
					},
					{
						field: 'rwmc',
						title: '任务名称'
					},
					{
						field: 'kssj',
						title: '开始时间'
					},
					{
						field: 'jsssj',
						title: '结束时间'
					},
					{
						field: 'zxzt',
						title: "状态",
						formatter: function (value, row, index) {
							if(value==0){
								return "未执行"
							}else if(value==1){
								return "已开始"
							}else {
								return "执行结束";
							}
						}
					},
					{
						title: '操作',
						formatter: function(value, row, index) {
							if (row.zxzt == 0) {
								var actions = [];
								actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
								return actions.join("");
							} else if (row.zxzt == 1){

								return "";
							}else {
								var actions = [];
								actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.view(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
								return actions.join("");
							}
						}
					}]
			};
			$.table.init(options);
		});




	</script>
</body>

</html>